
package com.hanhai.zrb.model.common.enums;


public enum ProvinceEnum {
	ANHUI(340000,"安徽"),
	BEIJING(110000,"北京"),
	NINGXIA(640000,"宁夏"),
	HUNAN(430000,"湖南"),
	TIANJIN(120000,"天津"),
	YUNNAN(530000,"云南"),
	SHANGHAI(310000,"上海"),
	XINJIANG(650000,"新疆"),
	HEBEI(130000,"河北"),
	GUANGXI(450000,"广西"),
	JAINGSU(320000,"江苏"),
	JILIN(220000,"吉林"),
	SHANDONG(370000,"山东"),
	NEIMENGGU(150000,"内蒙古"),
	GANSU(620000,"甘肃"),
	FUJIAN(350000,"福建"),
	HEILONGJIANG(230000,"黑龙江"),
	GUANGDONG(440000,"广东"),
	TAIWAN(710000,"台湾"),
	HUBEI(420000,"湖北"),
	XIANGGANGI(810000,"香港"),
	AOMEN(820000,"澳门"),
	ZHEJIANG(330000,"浙江"),
	HAINAN(460000,"海南"),
	XIZANG(540000,"西藏"),
	GUIZHOU(520000,"贵州"),
	CHONGQIN(500000,"重庆"),
	LIAONING(210000,"辽宁"),
	QINGHAI(630000,"青海"),
	JIANGXI(360000,"江西"),
	SHANXI(140000,"山西"),
	HENAN(410000,"河南"),
	SICHUAN(510000,"四川"),
	SANXI(610000,"陕西");
	
	
	private Integer code;

	private String name;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	private ProvinceEnum(Integer code,String name) {
		this.code = code;
		this.name = name;
	}
	
	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}
	
	public static String getProvinceName(String fullname){
		for(ProvinceEnum province :ProvinceEnum.values()){
			if(fullname.contains(province.getName().trim())){
				return province.getName().trim();
			}
		}
		return "";
	}
	
	public static String getProvinceName(Integer code){
		for(ProvinceEnum province :ProvinceEnum.values()){
			if(code.equals(province.getCode())){
				return province.getName().trim();
			}
		}
		return "";
	}
	
//	public static void main(String[] args) {
//
//		System.out.println(ProvinceEnum.getProvinceName(110000));
//	}

	
}
